<?php
include 'global.php';
include 'sub/editor.php';
include 'home.php';
include 'sub/header.php';
?>

<script type="text/javascript" src="../js/dialog.js"></script>
<script type="text/javascript">
    $(window).load(function() {
        $('a.light').lightBox();
    });
</script>
<script type="text/javascript">
    $(function(){
        nid = 0;
        $('#dialog').dialog({
            autoOpen: false,
            width: 310,
            modal: true,
            buttons: {
                "Submit": function() {
                    $('#nationform').submit();
                },
                "Đóng": function() {
                    $( this ).dialog( "close" );
                }
            }
        });

        $('#btaddnation').click(function(){
            $('#nationname').val('');
            $('#nationname2').val('');
            $('#vitri').val('');
            $('#nationid').val('');

            $('#dialog').dialog( "option", "title", 'Thêm quốc gia' );
            $('#dialog').dialog('open');
            return false;
        });
        $('.btBlue').click(function(){
            nid= $(this).attr('id');
            nationname = $('#name'+nid).html();
            nationnameen = $('#nameen'+nid).html();
            vt = $('#vt'+nid).html();
            $('#nationname').val(nationname);
            $('#nationname2').val(nationnameen);
            $('#vitri').val(vt);
            $('#nationid').val(nid);
            $('#dialog').dialog( "option", "title", 'Cập nhật quốc gia' );
            $('#dialog').dialog('open');
            return false;
        });
    });
</script>
<div class="content-outer">
    <div class="content-inner">
        <div class="title_border">
            <h1>Cấu hình</h1>
        </div>
        <form method="post"  action="webconfig">
            <table class="configtb" border="0" cellspacing="0" cellpadding="4" >
                <tr>
                    <td width="170">Tiêu đề web</td>
                    <td><input type="text" name="web_title" class="txtconfig" value="<?php echo Config::get('web_title'); ?>"/> </td>
                </tr>
                <tr>
                    <td width="170">Địa chỉ</td>
                    <td><input type="text" name="add" class="txtconfig" value="<?php echo Config::get('add'); ?>"/> </td>
                </tr>
                <tr>
                    <td width="170">Địa chỉ tiếng Anh</td>
                    <td><input type="text" name="add2" class="txtconfig" value="<?php echo Config::get('add2'); ?>"/> </td>
                </tr>
                <tr>
                    <td>Email nhận liên hệ</td>
                    <td><input type="text" name="email" class="txtconfig" value="<?php echo Config::get('email'); ?>"/> </td>
                </tr>
                <tr>
                    <td>Yahoo 1</td>
                    <td><input type="text" name="yh1" class="txtconfig" value="<?php echo Config::get('yh1'); ?>"/> </td>
                </tr>
                <tr>
                    <td>Yahoo 2</td>
                    <td><input type="text" name="yh2" class="txtconfig" value="<?php echo Config::get('yh2'); ?>"/> </td>
                </tr>
                <tr>
                    <td>Hotline (Tel)</td>
                    <td><input type="text" name="tel" class="txtconfig" value="<?php echo Config::get('tel'); ?>"/> </td>
                </tr>
                <tr>
                    <td>Hotline (Mobile)</td>
                    <td><input type="text" name="mobi" class="txtconfig" value="<?php echo Config::get('hotline'); ?>"/> </td>
                </tr>
                <tr>
                    <td>Số bài trên trang</td>
                    <td><input type="text" name="pagenum" class="txtconfig" value="<?php echo Config::get('num_per_page'); ?>"/> </td>
                </tr>
                <tr>
                    <td colspan="2" align="center" ><input type="submit" value="Cập nhật" name="submit"/> </td>
                </tr>
            </table>
        </form>
    </div>
</div>
<div class="content-outer" id="photobox">
    <div class="content-inner">
        <div class="title_border">
            <h1>Thư viện ảnh</h1>
            <div style="margin-top: 15px" class="rightbt">
                <ul>
                    <li><a href="photos"><span><span>Thêm hình ảnh</span></span></a></li>
                </ul>
            </div>
        </div>
        <div style="padding-top: 10px; float: left; width: 100%; height: auto">
            <?php echo $photolist ?>
        </div>
    </div>
</div>
<div class="content-outer">
    <div class="content-inner">
        <div class="title_border">
            <h1>Giới thiệu</h1>
        </div>
        <form method="post" onsubmit="tinyMCE.get('about').save();" action="about">
            <table width="100%" cellpadding="0" cellspacing="0" style="float: left; height: auto; width: 100%">
                <tr>
                    <td style="padding: 5px 0">
                        <textarea class="ckeditor" name="about" style="height: 200px; width: 100%"><?php echo Config::get('about') ?></textarea>
                    </td>
                </tr>
            </table>
    </div>
    <div class="content-inner">
        <div class="title_border">
            <h1>Giới thiệu tiếng Anh</h1>
        </div>
            <table width="100%" cellpadding="0" cellspacing="0" style="float: left; height: auto; width: 100%">
                <tr>
                    <td style="padding: 5px 0">
                        <textarea name="about2" style="height: 200px; width: 100%"><?php echo Config::get('about2') ?></textarea>
                    </td>
                </tr>
                <tr>
                    <td>
                        <input type="submit" name="submit" value="Cập nhật"/>
                    </td>
                </tr>
            </table>
        </form>
    </div>
</div>
<div class="content-outer" id="nationbox">
    <div class="content-inner">
        <div class="title_border">
            <h1>Danh sách quốc gia</h1>
            <div style="margin-top: 15px" class="rightbt">
                <ul>
                    <li><a id="btaddnation" href="#"><span><span>Thêm quốc gia</span></span></a></li>
                </ul>
            </div>
        </div>
        <table width="50%" cellspacing="0" cellpadding="0" class="das">
            <tbody>
                <tr>
                    <th class="check"></th>
                    <th class="quickaction2"><a href="#">Tên quốc gia</a></th>
                    <th class="quickaction2"><a href="#">Tên tiếng Anh</a></th>
                    <th><a>Vị trí</a></th>
                    <th class="tool">Công cụ</th>
                </tr>
                <?php echo $nationlist ?>
            </tbody>
        </table>
    </div>
</div>
<div id="dialog"  title="Thêm Quốc Gia" >
    <form method="post"  action="nation" id="nationform">
        <br>
        <input type="hidden" name="nationid" id="nationid"/>
        Tên nước &nbsp;<input type="text" name="nationname" id="nationname" style="width: 200px" /><br>
        Tiếng Anh <input type="text" name="nationname2" id="nationname2" style="width: 200px" /><br>
        Vị trí &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <input type="text" name="vitri" id="vitri" style="width: 100px" />
    </form>
</div>
<?php
                include 'sub/footer.php';
?>